#ifndef _CONTROLLER_H_
#define _CONTROLLER_H_

#include "EventProcessor.h"
#include "EventProcessorImp.h"
#include "Message.h"
#include "DistributedCounter.h"
#include <string>
#define REPETITIONS 1000

class ControllerImp : public EventProcessorImp {
private:

  string plainText[10];
  string cipherText[10];	

  int currentBlock;

  void SendBlock(EventProcessor& decrypter);

  void Initialize();	  
 
  void ExtractInfo(string plain);
	
  ControllerImp(void);
  	
  // message handler for the return OK
  
  MESSAGE_HANDLER_DECLARATION(Created);
  	

  MESSAGE_HANDLER_DECLARATION(DecryptionDone);

  MESSAGE_HANDLER_DECLARATION(Finished);

	
  MESSAGE_HANDLER_DECLARATION(Die);

  friend class Controller;
};

// Interface class
class Controller : public EventProcessor {
public:
  //Controller(EventProcessor& _adder, DistributedCounter& _dCounter);
  Controller(void);
};

inline Controller::Controller(void){
	evProc = new ControllerImp();
}

/*
inline Controller::Controller(EventProcessor& _adder, DistributedCounter& _dCounter){
  evProc = new ControllerImp(_adder, _dCounter);
}
*/
#endif 
